Repository navigation
Conversation
|
The PR is put as a draft until kbss-cvut/jopa#483 is resolved, causing the rollback of a MultilingualString property possibly discarding all translations except one. |
|
JOPA 2.12.4 with the corresponding fix has been released, so should be ready to update and then can be reviewed |
…rollbacking service
… types to primitives in MetamodelRollbackValidator and fix ChangeRollbackDao reporting entity existance from inferred statements
…ng custom attributes referencing terms and possibly vocabularies
…nge sub-class of UpdateChangeRecord. Introduce rollback endpoints.
…ase context sharing between test methods
…custom attributes with Term range
…history is returned with reversible types and rollback endpoint resolves update change record and calls rollback
…ange records from VocabularyController
…points in TermController and VocabularyController
…uring history is returned with reversible types and rollback endpoint resolves update change record and calls rollback
…thReversibleType method
…dRecordByLocalName method
…ndCustomAttribute and ChangeRecordDao#find
…service integration tests
…tilingual string does not discard other transaltions
c73a133 to
ff9acd3
Compare
…ected and fix rollbackOfMultilingualStringPreservesOtherTranslations test asserting equality of different object types
ff9acd3 to
def14fb
Compare
ledsoft
left a comment
There was a problem hiding this comment.
Feels overengineered, I was expecting something simple using a SPARQL Update with some infrastructure around. But it is true that that would not produce the record of reverting the change.
Anyway, couple of change requests for simplification/refactoring, will test afterwards.
I would also need to explicitly handle possible related changes that are not part of the change record (e.g. Term being root term in a vocabulary). And that, on the other side, sounds more like an ad-hoc solution. |
…nd call ChangeRecordDao directly from ChangeRollbackService
19104f0 to
7a95974
Compare
…rs and enrich change records with rollback possibility information in ChangeRecordService
…replace it with direct references to the Vocabulary#s_c_reversible_change
Implements kbss-cvut/termit-ui#790
Frontend PR: kbss-cvut/termit-ui#876
Rollback restrictions:
For example, when the original value referenced term that was already deleted, the rollback wont be possible, because the reference would be invalid. Whether the referenced resource is (or was) an asset is being resolved using the metamodel and custom attributes (with Term range).
Resource (IRI/URI/URL)range exists.This means the URI is a general resource, and its existence will not be validated.
About additional properties:
Applying rollback creates a new change record and does not change previous change records.
Changes
This PR adds:
termit:reversible-changerepresenting a reversible update of an entity./historyendpoints ofVocabularyandTermaddingtermit:reversible-changetype to change records that can be rolled back by the current user.ChangeRollbackServicefor performing rollbacksRollbackValidatorvalidates whether the rollback of the given update change record would be possible without breaking the rules above